#pragma once

#if defined(WIN32) || defined(WIN64)
#ifdef LIBDBC_EXPORTS
#define LIBDBC_API __declspec(dllexport)
#else
#define LIBDBC_API __declspec(dllimport)
#endif
#else
#ifndef LIBDBC_API
#define LIBDBC_API
#endif

#ifndef BOOL
#define BOOL bool
#endif
#endif

#ifndef NULL
#define NULL 0
#endif

// connection apis that are available on win(32) plattform only
#ifdef WIN32
#define DBMS_INCLUDE_ODBC   2
#define DBMS_INCLUDE_ODBC3  3
#define DBMS_INCLUDE_SQLSERVER2005 4
#endif

//#define DBMS_INCLUDE_ORACLE 5

#ifdef DBMS_INCLUDE_POSTGRESQL
#undef DBMS_INCLUDE_POSTGRESQL
#define DBMS_INCLUDE_POSTGRESQL 6
#endif

#ifndef NAMESPACE_LIBDBC
#define NAMESPACE_LIBDBC libdbc
#define LIBDBC_BEGIN_NAMESPACE namespace LIB_DBC {
#define LIBDBC_END_NAMESPACE }
#endif

// support not MS lib-calls, 
#if !defined(WIN32) && !defined(WIN64)

char* strcpy_s(char* target, int len, const char* source);

void __myDebugBreak();

#if !defined(__APPLE__)
void __debugbreak();
#endif

#endif

LIBDBC_BEGIN_NAMESPACE

enum DBCFieldType
{
	DBC_TYPE_UNKNOWN = 0,
	DBC_TYPE_VARCHAR,
	DBC_TYPE_CHAR,
	DBC_TYPE_TINYINT,
	DBC_TYPE_SMALLINT,
	DBC_TYPE_INTEGER,
	DBC_TYPE_DECIMAL,
	DBC_TYPE_FLOAT,
	DBC_TYPE_DOUBLE,
	DBC_TYPE_DATE,
	DBC_TYPE_TIME,
	DBC_TYPE_TIMESTAMP,
	DBC_TYPE_DATETIME,
	DBC_TYPE_YEAR,
	DBC_TYPE_BLOB,
	DBC_TYPE_COMPLEX,
	DBC_TYPE_BIT,
	DBC_TYPE_GUID,
	DBC_TYPE_NULL
};

LIBDBC_END_NAMESPACE